/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.nyquistmeteocal.boundary;

import it.nyquistmeteocal.entity.UserNotification;
import java.security.Principal;
import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author gatb27
 */
@Stateless
public class UserNotificationManager {
    @PersistenceContext
    public EntityManager unm;
    
    @Inject
    Principal principal;

    public void saveUserNotification(UserNotification usernotification) {
        unm.persist(usernotification);     
    }
    
    public void deleteUserNotification(UserNotification usernotification) {
        UserNotification untbr = unm.getReference(UserNotification.class, usernotification.getId());
        unm.remove(untbr);
        
        
    }

    
    
}
